/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.trumah.model;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author rafaell
 */
@Entity
@Table(name = "Doador_Fisico")
@NamedQueries({@NamedQuery(name = "DoadorFisico.findAll", query = "SELECT d FROM DoadorFisico d"), @NamedQuery(name = "DoadorFisico.findById", query = "SELECT d FROM DoadorFisico d WHERE d.id = :id"), @NamedQuery(name = "DoadorFisico.findByCpf", query = "SELECT d FROM DoadorFisico d WHERE d.cpf = :cpf")})
public class DoadorFisico extends Doador implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Column(name = "cpf")
    private Long cpf;
    @JoinColumn(name = "doador_id", referencedColumnName = "id")
    @ManyToOne
    private Doador doadorId;

    public DoadorFisico() {
    }

    public DoadorFisico(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCpf() {
        return cpf;
    }

    public void setCpf(Long cpf) {
        this.cpf = cpf;
    }

    public Doador getDoadorId() {
        return doadorId;
    }

    public void setDoadorId(Doador doadorId) {
        this.doadorId = doadorId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DoadorFisico)) {
            return false;
        }
        DoadorFisico other = (DoadorFisico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "trumah.DoadorFisico[id=" + id + "]";
    }

}
